{%extends file="base_content.html"%}
{%block name="breadcrumb"%}
<li class="active">用户管理</li>
{%/block%}

{%block name="content"%}

<div class="page-header">

    <div class="row">

        <div class="col-xs-8">
            <form class="form-inline" style="width: 300px" method="post">

                <div class="input-group">
                    <input type="text" class="form-control search-query" name="mobile" placeholder="手机号" value="{%$mobile%}">
                        <span class="input-group-btn">
                            <button type="submit" class="btn btn-purple btn-sm">
                                查询
                                <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
                            </button>
                        </span>
                </div>
            </form>
        </div>
    </div>


</div>

<table id="sample-table-2" class="table table-striped table-bordered table-hover">
    <thead>
    <tr>


        <th>用户编号</th>
        <th>用户昵称</th>
        <th>手机号</th>
        <th>楼</th>
        <th>层</th>
        <th>号</th>
    </tr>
    </thead>

    <tbody>
    {%foreach from=$list item=value%}
    <tr>

        <td>{%$value.member_id%}</td>
        <td>{%$value.member_name%}</td>
        <td>{%$value.mobile%}</td>
        <td>{%$value.lou%}</td>
        <td>{%$value.ceng%}</td>
        <td>{%$value.hao%}</td>
    </tr>
    {%foreachelse%}
    {%include file="inc_gritter.html"%}
    {%/foreach%}
    </tbody>
</table>
{%$pagerbar%}
{%/block%}

{%block name="js"%}
<script>
    function deleteEntity(id,btn){


        $.get("index.php?c=user&m=delete&id="+id,function(r){
            if(r=='{%$smarty.const.STATUS_SUCCESS%}'){
                tr_row = btn.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
                list_table=tr_row.parentNode;
                list_table.removeChild(tr_row);
            }else{
                alert("删除失败");
            }
        });

    }

    function updateStatus(id,cb){
        $.get("index.php?c=user&m=status&id="+id+"&status="+(cb.checked?1:0),function(r){
            if(r=='{%$smarty.const.STATUS_SUCCESS%}'){

            }else{
                if(cb.checked){
                    cb.checked = false;
                }else{
                    cb.checked = true;
                }
            }
        });

    }
</script>
{%/block%}